<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            $table->increments('id');
            $table->string('no')->comment('订单号');
            $table->decimal('allprice', 8, 2)->comment('订单总价');
            $table->unsignedInteger('uid')->comment('用户id');
            $table->unsignedInteger('addrid')->comment('地址id');
            $table->unsignedSmallInteger('paytype')->comment('付款方式');
            $table->unsignedSmallInteger('orderstatus')->comment('订单状态1新订单 2付款 3发货 4完成 5退货 6退货完成');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('orders');
    }
}
